package cn.jly.boot.mp.redis;

import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

/**
 * @author lanyangji
 * @description jedis工具类
 * @date 2020/12/29 下午 7:49
 */
public class JedisUtils {
    private JedisUtils() {}

    /**
     * 获取连接池
     * @return
     */
    public static JedisPool getJedisPool() {
        final GenericObjectPoolConfig<Jedis> config = new GenericObjectPoolConfig();
        config.setMaxTotal(100);
        config.setMaxIdle(20);
        return new JedisPool(config, "192.168.172.101", 7001);
    }
}
